package br.mikhas.util.test.matcher;

import java.util.Collection;

import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;

public final class Matchers {
	private Matchers() {
	}

	public static Matcher<? extends Collection<?>> empty(
			final Collection<?> collection) {
		return new BaseMatcher<Collection<?>>() {
			@SuppressWarnings("rawtypes")
			@Override
			public boolean matches(Object arg) {
				if (arg instanceof Collection) {
					return ((Collection) arg).isEmpty();
				}
				return false;
			}

			@Override
			public void describeTo(Description arg0) {
				// TODO Auto-generated method stub
			}
		};
	}
}
